<template>
  <div class="app-container user">
    <van-nav-bar title="我的" left-arrow @click-left="$router.back()" />
    <div class="content">
      <el-scrollbar>
        <div class="user-box">
          <div class="avatar">{{ '张三' }}</div>
          <div class="user-info">
            <div class="user-name">{{ '张三' }}</div>
            <div class="user-depart">{{ '广州电信客服部' }}</div>
          </div>
        </div>
        <div class="serve-box">
          <div class="serve-title">其他服务</div>
          <div class="content-box">
            <div class="serve-item" v-for="item in serveItemList" :key="item.label">
              <svg-icon :icon-class="item.icon" />
              <div class="label">{{ item.label }}</div>
            </div>
          </div>
        </div>
      </el-scrollbar>
    </div>
    <TabBar />
  </div>
</template>

<script>
import TabBar from '@/views/mindStation/components/TabBar.vue';

export default {
  name: 'MindStationIndex',
  components: { TabBar },
  data() {
    return {
      serveItemList: [
        { label: '测评记录', icon: 'wallet' },
        { label: '心理辅导记录', icon: 'shopping-bag' },
        { label: '心理科普记录', icon: 'record' },
        // { label: '客服咨询', icon: 'chat' },
        // { label: '常见问题', icon: 'question' },
      ],
    };
  },
};
</script>

<style lang="scss" scoped>
.content {
  width: calc(100% - 30px);
  height: calc(100% - 110px);
  padding: 0 15px;

  ::v-deep .el-scrollbar {
    height: 100%;
  }

  .user-box {
    margin: 15px 0;
    display: flex;
    .avatar {
      width: 64px;
      height: 64px;
      margin: 0 20px;
      border-radius: 50%;
      background-color: #1477ff;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 22px;
      font-weight: bold;
      color: #fff;
    }
    .user-info {
      flex: 1;
      padding: 5px 0;
      // margin-left: 20px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .user-name {
        font-size: 20px;
      }
      .user-depart {
        font-size: 12px;
        color: #aab0ba;
      }
    }
  }

  .serve-box {
    padding: 15px;
    border-radius: 6px;
    background-color: #fff;
    .serve-title {
      margin-bottom: 15px;
    }
    .content-box {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      .serve-item {
        // width: 25%;
        text-align: center;
        // margin-right: calc((100% - 260px) / 2);
        margin-top: 10px;
        &:nth-child(4n) {
          margin-right: 0px;
        }
        &:nth-child(-n + 4) {
          margin-top: 0px;
        }
        .svg-icon {
          font-size: 32px;
          margin-bottom: 5px;
        }
        .label {
          font-size: 13px;
        }
      }
    }
  }
}
</style>
